package com.sunshine.client.service;

import com.sunshine.client.annotation.ApiServer;
import com.sunshine.client.bean.User;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @author Mokairui
 * @description frame-module
 * @since 2022/5/8
 */
@ApiServer("http://localhost:8080/user")
public interface IUserApi {
    
    @GetMapping("/")
    Flux<User> getAllUser();
    
    @GetMapping("/{id}")
    Mono<User> getUserById(@PathVariable("id") String id);
    
    @DeleteMapping("/{id}")
    Mono<Void> deleteUserById(@PathVariable("id") String id);
    
    @PostMapping("/")
    Mono<User> createUser(@RequestBody Mono<User> user);
}
